import java.awt.*;
import java.awt.geom.*;

// A line that can be moved around.
public class LineShape implements EditableShape
{
	// Constructs a line item.
	// px1, py1 the x,y coordinates of the first point of the line
	// px2, py2 the x,y cooridantes of the second point of the line
	public LineShape(double px1, double py1, double px2, double py2)
	{
		this.px1 = px1;
		this.py1 = py1;
		this.px2 = px2;
		this.py2 = py2;
	}

	public void draw(Graphics2D g2)
	{
		// the start point of the line
		Point2D.Double p1 = new Point2D.Double(px1, py1);
		
	    // the end point of the line
	    Point2D.Double p2 = new Point2D.Double(px2, py2);
	    
	    // create the line
	    Line2D.Double line = new Line2D.Double(p1, p2);
	    
	    // draw the line
	    g2.draw(line);
	}
   
	private double px1;
	private double py1;
	private double px2;
	private double py2;
	// END OF CLASS
}